package org.example;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
 
public class Main{
    public static void main(String[] args){
    	Scanner in = new Scanner(System.in);
    	Set<String> set = new HashSet<String>();
    	while(true) {
    		String aString = in.next();
    		if(aString.equals("!!!!!")) {
    			break;
    		}
    		set.add(aString.toLowerCase());
    	}
    	System.out.println(set.size());
    }
}